﻿<Page
    x:Class="Studio77.FruitLinkLink2.Pages.GamePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Studio77.FruitLinkLink2.Pages"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:localView="using:Studio77.FruitLinkLink2.Views"
    mc:Ignorable="d">
	<Page.Resources>
		<Style x:Key="ButtonStyleReset" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="#FF915624" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FFEA9E6A" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FF592400" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="border" BorderBrush="#FFB8B8B8" BorderThickness="1" CornerRadius="13">
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FF6A9EEA"/>
										<GradientStop Color="#FF002459" Offset="1"/>
										<GradientStop Color="#FF245091" Offset="0.25"/>
									</LinearGradientBrush>
								</Border.Background>
								<Image Source="ms-appx:///Image/refresh2.png" Stretch="Fill" Margin="10"/>
							</Border>
							<ContentPresenter HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,5,0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStyleFind" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimation Duration="0" To="#FF915624" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FFEA9E6A" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
											<ColorAnimation Duration="0" To="#FF592400" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="border" BorderBrush="#FFB8B8B8" BorderThickness="1" CornerRadius="13">
								<Border.Background>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FF6A9EEA"/>
										<GradientStop Color="#FF002459" Offset="1"/>
										<GradientStop Color="#FF245091" Offset="0.25"/>
									</LinearGradientBrush>
								</Border.Background>
							</Border>
							<ContentPresenter HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,5,0"/>
							<Rectangle HorizontalAlignment="Left" Height="45.929" Margin="45.731,43.893,0,0" Stroke="#FF7E7E7E" VerticalAlignment="Top" Width="8.748" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Visibility="Collapsed">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.201,0.509" StartPoint="1.026,0.508">
										<GradientStop Color="White"/>
										<GradientStop Color="#FFA0A0A0" Offset="0.517"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
								<Rectangle.RenderTransform>
									<CompositeTransform Rotation="-33.567"/>
								</Rectangle.RenderTransform>
							</Rectangle>
							<Ellipse HorizontalAlignment="Left" Height="43" Margin="8,14,0,0" VerticalAlignment="Top" Width="43" StrokeThickness="3" Visibility="Collapsed">
								<Ellipse.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFC2F9FF"/>
										<GradientStop Color="#FFA0D9E2" Offset="1"/>
										<GradientStop Color="#FFF8FEFF" Offset="0.254"/>
									</LinearGradientBrush>
								</Ellipse.Fill>
								<Ellipse.Stroke>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFA6A6A6"/>
										<GradientStop Color="White" Offset="1"/>
										<GradientStop Color="#FF474747" Offset="0.711"/>
									</LinearGradientBrush>
								</Ellipse.Stroke>
							</Ellipse>
							<Image Source="ms-appx:///Image/light_bulb2.png" Stretch="Fill" Margin="10"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ButtonStylePause" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
											<DoubleAnimation Duration="0" To="1.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="PointerOver"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image x:Name="image" Source="ms-appx:///Image/button06.png" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
								<Image.RenderTransform>
									<CompositeTransform/>
								</Image.RenderTransform>
							</Image>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Name="StoryboardReadyGo">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image">
				<EasingDoubleKeyFrame KeyTime="0" Value="1.2"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1.857">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.1">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image">
				<EasingDoubleKeyFrame KeyTime="0" Value="1.2"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1.857">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.1">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<CubicEase/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
			<DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True">
				<DoubleAnimation.EasingFunction>
					<CubicEase/>
				</DoubleAnimation.EasingFunction>
			</DoubleAnimation>
		</Storyboard>
	</Page.Resources>

    <Viewbox>

		<Grid Background="#FF575757" Height="768" Width="1366">
			<Grid.RowDefinitions>
				<RowDefinition Height="116"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<Image Source="ms-appx:///Image/gameback.jpg" Stretch="Fill" Grid.RowSpan="2" Opacity="0.5"/>
			<localView:TimeProcessView x:Name="process" Height="77" VerticalAlignment="Center" Width="1100" Margin="133,20,133,19"/>
			<localView:LinkGameCanvas x:Name="gameCanvas" Width="900" Height="600" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="233,26"/>
			<Border Margin="1209,89,14,126" Grid.Row="1" Background="#C4CDCDCD" CornerRadius="15">
				<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
					<Button x:Name="btnReset" Content="3" Margin="0,0,0,203" Style="{StaticResource ButtonStyleReset}" FontSize="48" Width="100" Height="100" Foreground="Red" Click="btnReset_Click"/>
                    <Button x:Name="btnFind" Content="3" Margin="0,203,0,0" Style="{StaticResource ButtonStyleFind}" FontSize="48" Foreground="Red" Width="100" Height="100" Click="btnFind_Click"/>
				</Grid>
			</Border>
			<Border Margin="14,89,1213,126" Grid.Row="1" Background="#C4CDCDCD" CornerRadius="15">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="49*"/>
						<RowDefinition Height="52*"/>
						<RowDefinition Height="78*"/>
						<RowDefinition Height="44*"/>
						<RowDefinition Height="214*"/>
					</Grid.RowDefinitions>
					<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="当前关卡" VerticalAlignment="Bottom" FontSize="24" Margin="22,0,21,0" Height="29" Width="96"/>
					<TextBlock x:Name="txtCurrentStage" HorizontalAlignment="Center" Grid.Row="1" TextWrapping="Wrap" Text="2/30" VerticalAlignment="Bottom" FontSize="32" Foreground="Red"/>
					<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="关卡得分" VerticalAlignment="Bottom" FontSize="24" Grid.Row="2" Margin="22,0,21,0" Height="29" Width="96"/>
					<TextBlock x:Name="txtScore" HorizontalAlignment="Center" Grid.Row="3" TextWrapping="Wrap" Text="5177" VerticalAlignment="Bottom" FontSize="28" Foreground="Red"/>
					<Button x:Name="btnPause" Style="{StaticResource ButtonStylePause}" FontSize="48" Foreground="White" Width="100" Height="100" Grid.Row="4" HorizontalAlignment="Center" Margin="20,59,19,55" Click="btnPause_Click"/>
				</Grid>
			</Border>
			<localView:PauseBlockView x:Name="pauseBlock" Grid.RowSpan="2" Visibility="Collapsed"/>
			<localView:LoseBlockView x:Name="loseBlock" Grid.RowSpan="2" Visibility="Collapsed"/>
			<localView:WinBlockView x:Name="winBlock" Grid.RowSpan="2" Visibility="Collapsed"/>
			<Border x:Name="bdrReady" BorderThickness="1" HorizontalAlignment="Left" Height="768" Grid.RowSpan="2" VerticalAlignment="Top" Width="1366" Background="#4CB0B0B0" Visibility="Collapsed">
				<Image x:Name="image" Source="ms-appx:///Image/ready_go.png" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Width="369" Height="70" Margin="498,348,497,348" RenderTransformOrigin="0.5,0.5">
					<Image.RenderTransform>
						<CompositeTransform/>
					</Image.RenderTransform>
				</Image>
			</Border>
		</Grid>
	</Viewbox>
</Page>